
public class string6 {

	public static void main(String[] args) throws Exception
	{
		String str = "sdljflksj kjk lksldkf lk j11111111111111111";
		StringBuilder strb = new StringBuilder(str);
		int minLen = strb.length(), maxLen = 0, count = 0;
		for(int i = 0; i < strb.length(); i++)
		{
			if(i == strb.length() - 1)
			{
				if(count > maxLen) maxLen = ++count;
				if(count < minLen) minLen = ++count;				
			}
			if(strb.charAt(i) != ' ')
				count++;
			else
			{
				if(count > maxLen) maxLen = count;
				if(count < minLen) minLen = count;
				count = 0;
			}
		}
		System.out.println(minLen + ", " + maxLen);
	}

}
